package great.project.bean.depend;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.stereotype.Component;

public class Demo {
	public static void main(String[] args) {
		ApplicationContext context = new AnnotationConfigApplicationContext("great.project.bean.depend");
		Object a = context.getBean("a",A.class);
		System.out.println(a.toString());
	}
}


@Component
class A {
	@Autowired
	private B b;

}

@Component
class B {
	@Autowired
	private A a;

}